package com.example.demo.entity;

import java.io.Serializable;

/**
 * Description:
 * <p>@author: LUO</p>
 * Date: 2019-05-16 7:52
 **/
public class JsonResultVO<T> implements Serializable {

    private Integer code;

    private String msg;

    private T data;

    public JsonResultVO(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = null;
    }

//    public JsonResultVO(ServiceCodeEnum serviceCodeEnum) {
//        this.code = serviceCodeEnum.getCode();
//        this.msg = serviceCodeEnum.getMessage();
//        this.data = null;
//    }

    public JsonResultVO(T data) {
        this.code = 0;
        this.msg = "成功";
        this.data = data;
    }

    public JsonResultVO() {
        this.code = 0;
        this.msg = "成功";
        this.data = null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
